package com.base.system.managedBean;

import java.io.Serializable;

import org.operamasks.faces.annotation.Action;
import org.operamasks.faces.annotation.Bind;
import org.operamasks.faces.annotation.ManagedBean;
import org.operamasks.faces.annotation.ManagedBeanScope;
import org.operamasks.faces.component.layout.UICell;
import org.operamasks.faces.user.util.Browser;

import com.base.commonKey.entity.CommonKey;
import com.base.security.SecurityConst;
import com.base.system.managedBean.baseBean.BaseCommonKeyBean;

/**
 * 
 * This managed bean is generated automatically
 */
@ManagedBean(name = "system_addCommonKeyBean", scope = ManagedBeanScope.REQUEST)
public class AddCommonKeyBean extends BaseCommonKeyBean implements Serializable {

	@Action(id = "saveCommonKey")
	public void saveCommonKey() {
		commonKey = new CommonKey();
		// commonKey.setCommonKey(commonKey);
		setCommonKeyProperty();
		commonKeyDao.insert(commonKey);
		// commonKeyDao.saveOrUpdate(commonKey);

		String script = "closeCenterLayoutTab('"
				+ SecurityConst.COMMONKEY_ADD_TAB + "')";
		Browser.execClientScript("window.top", script);
	}

	@Bind(id = "parentIdTitle")
	private UICell parentIdTitle;

	@Bind(id = "parentIdContent")
	private UICell parentIdContent;

}
